/************************************************/
/*creator: johan candelaria						*/
/*project name: 								*/
/*notes: 										*/
/*		 										*/
/*												*/
/*contact: gohan127@gmail.com					*/
/*												*/
/*hardware: 	pic 18f4550						*/
/*				sw1 d1							*/
/*				led1= d2						*/
/*												*/
/*												*/
/*												*/
/*												*/
/************************************************/
	/*includes*/

#include <p18f4550.h>
#include <delays.h>
#include <string.h>
#include <timers.h>
#include "lcd.h"
#include "rs232.h"


	/*defines*/
#define Fosc 14745600
#define Fcy  14745600/4	/* we draaien op ((16mhz/4)*24(=96))/2=48mhz */						//voor de header files

#define _BV(bit) (1 << (bit))
#define bit_is_set(register,bit) (register & (1 << (bit)))
#define bit_is_clear(register,bit) (!(register & (1 << (bit)))) 
#define MAXSLAVES 3																			//nu worden slaves met de naam 01,02 en 03 getest.
	
	/* Set up the configuration bits */
	//#pragma config PLLDIV = 1,CPUDIV = OSC1_PLL2,USBDIV = 2,FOSC = HS						//voor USB de voltage regulater aanzetten
	//#pragma config PWRT = ON,BOR = ON,BORV = 28,VREGEN = OFF,WDT = OFF,LPT1OSC = OFF,PBADEN = OFF
	//#pragma	STVREN = OFF,MCLRE = OFF
	/* User defines these routines according to the oscillator frequency */


void main (void)
	{
		InitLCD();
		//InitTimer1();
		putsROM2LCD("jCt");
		TRISDbits.TRISD2=0;
		while(1)
		{	
		if(charReceived232())
		{
			putc232(getChar232());
		}
		LATD^= _BV(2);
		//LATDbits.LATD2=1;
		Delay10KTCYx(150);
		}
	}




